import xlrd


# data = xlrd.open_workbook('./lc.xlsx')
# # print(data.sheet_names())
# table = data.sheet_by_index(0)
# ls = table.col_values(1, start_rowx=1)


# for i in range(1, 15):
#     print(i)

class Lcexcil(object):
    def __init__(self, file):
        self.data = xlrd.open_workbook(file)
        self.table = self.data.sheet_by_index(0)
        self.putin_on = self.table.cell(0, 1).value
        self.order = self.table.col_values(0, start_rowx=16)
        self.market_id = self.table.col_values(1, start_rowx=16)
        self.brand = self.table.col_values(2, start_rowx=16)
        self.brand_num = self.table.col_values(3, start_rowx=16)
        self.type = self.table.col_values(4, start_rowx=16)
        self.goods_name = self.table.col_values(5, start_rowx=16)
        self.putin_fee = eval(self.table.cell(0, 6).value[1:])
        self.rows = self.order.__len__()
        self.goods_num = []
        self.goods_money = []

    def get_values(self):
        x = self.table.col_values(6, start_rowx=16)
        for a in x:
            self.goods_num.append(eval(a[0:-1]))

        i = self.table.col_values(10, start_rowx=16)
        for j in i:
            self.goods_money.append(eval(j[1:]))


if __name__ == '__main__':
    lc = Lcexcil('./lc.xlsx')
    lc.get_values()
